<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
  <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
</head>
<body>
<script>
  function getnews(){
    $.ajax({
      type:"post",
      url:"http://localhost:8080/getnews",
      contentType:"application",
      success:function (res){
        console.log(res)
        document.getElementById("title").innerText=res.title
        document.getElementById("content").innerText=res.content
      }
            }
    )
  }
</script>
<div id="title">title</div>
<div id="content">content</div>
<button onclick="getnews()">获取数据</button>
</body>
</html>